home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
FROMUTS
/
ARCAUT
/
Automatons
/
Hodge
< prev
next >
Wrap
Text File
|
1991-07-27
|
915b
|
37 lines
AUTOMATON*
Hodge_Podge
An interesting 256 state Moore neighbourhood automaton, originally
described in 'Scientific American'. Compare the behaviour with the much
simpler 'Rug'. This is a slow automaton, as it requires a division
calculation to be performed for each cell, so try a window of size 50x50.
INITIALISATION*
10DEF PROCdo
20*SetEval wrap on
30*SetEval sick 255
40*SetEval g 3
50*SetEval k1 2
60*SetEval k2 1
70ENDPROC
SCREEN*
10DEF PROCdo
20DIM buf% 256:SYS "OS_ReadVarVal","sick",buf%,256:sick=!buf%
30PROCsoup(0,sick+1,1)
40ENDPROC
CODE*
( READ_NEIG
CELL <sick> = IF (dead ==)
CELL dead = IF (dead SCOUNT_ALL DUP <k2>
DIV TRASH SWAP <sick> SCOUNT_ALL
+ 9 SWAP - <k2> DIV TRASH + == )
ELSE (SUM_ALL [dead+1] [<sick>-1] MCOUNT_ALL
DIV TRASH <g> + == ) )
END*